#include<stdio.h>
#include<stdlib.h>
#include <conio.h>
int main()
{
	int i,j,x=9,y=9,score=0;
	char input;
	int ny=10,is_fired=0,is_killed=0,a=0,b=0;

	
	while(1)
	{
		system("cls");
        printf("score=%d\n",score);



	if((is_killed==0)||(a==0))
	{
		for(i=1;i<ny;i++)
			printf(" ");
		printf("+\n");	
	}
	else
		b=1;






		if(is_fired==0)
	{
	for(i=1;i<x;i++)
		printf("\n");
		}

		else
		{
			for(i=1;i<x;i++)
			{
				for(j=1;j<y;j++)
				
					printf(" ");
					printf("  |\n");
				
		}
		is_fired=0;
		}




	
	for(j=1;j<y;j++)
		printf(" ");
	printf("  *\n");
	for(j=1;j<y;j++)
	    printf(" ");
	printf("*****\n");
	for(j=1;j<y;j++)
	    printf(" ");
	printf(" * *\n");
		
	
	input=getch();


	if(input=='w')
		x=x-1;
	if(input=='s')
		x=x+1;
	if(input=='a')
		y=y-1;
	if(input=='d')
		y=y+1;
	if(input==' ')
	is_fired=1;

	if((y+2==ny)&&(is_fired==1))
	{
		is_killed=1;	
		score=score+1;
		a=1;

	}
	else
		is_killed=0;

	if(is_killed==1&&b==1)
	ny=ny+3;

	}
	
	return 0;
}
	
